/************************************************************************/
/* GUI                                                                  */
/************************************************************************/
#include "GUI/Buttons/BaseButton.h"

using namespace TD_Core;

namespace TD_GUI {

	const string BaseButton::m_defaultFont = "Fonts/SuperMarioBros.ttf";
	const Color BaseButton::m_defaultFontColor(Color::WHITE);
	const unsigned int BaseButton::m_defaultFontSize = 14;
	const string BaseButton::m_defaultButtonFile = "GUI/Buttons/defaultButton.png";

	BaseButton::BaseButton() : Tile(){
		m_mouseOver = &defaultMouseOver;
		m_mouseClicked = &defaultClick;
	}


	BaseButton::BaseButton(const Coord2D &buttonPosition, const Coord2D &buttonSize) : Tile(buttonPosition) {
		m_shapes.push_back(new RectangleShape(buttonPosition, buttonSize));
		m_mouseOver = &defaultMouseOver;
		m_mouseClicked = &defaultClick;
		const Color tempColor(0,0,0);
		m_pImage = TD_Resources::ResourceManager::loadImage(m_defaultButtonFile, Color::WHITE);
	}
	BaseButton::BaseButton(const Coord2D &buttonPosition, const Coord2D &buttonSize, shared_ptr<SDLImage> g_pImage) 
		: Tile(buttonPosition) {
		m_shapes.push_back(new RectangleShape(buttonPosition, buttonSize));
		m_mouseOver = &defaultMouseOver;
		m_mouseClicked = &defaultClick;

		m_pImage = g_pImage;
	}


	/************************************************************************/
	/* Rendering                                                            */
	/************************************************************************/
	void BaseButton::render(SDL_Surface *const g_destSurface, unsigned int deltaTime) {
		if(m_pImage != NULL) {
			blitSurface(g_destSurface);
		}
	}

	BaseButton::~BaseButton() {

	}


}